﻿#region Using namespaces

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

#endregion

namespace BOL.Apps.GeneNetworkBrowser.Converters
{
    public class NameValueMultiBindingConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var parameters = (object[])values;
            return new NameValueConverterResult
            {
                Name = (string)parameters[0],
                Value = parameters[1]
            };
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter,
                                    System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class NameValueConverterResult
    {
        //The name of the model property to set 
        public string Name { get; set; }

        //The value we're setting it to 
        public object Value { get; set; }
    } 

}
